export const useReloadPage = () => {
  const { proxy } = getCurrentInstance()!
  // 询问是否要刷新
  const reloadPage = async ({
    title = "是否刷新",
    message = "你确定"
  } = {}) => {
    try {
      await proxy!.$confirm(title, message)
      window.location.reload()
    } catch {
      proxy?.$message.warning("已经取消了刷新")
    }
  }
  return {
    reloadPage
  }
}
